---
title: Faults and error pipeline
summary: The fault pipeline for SAIF.Services.WCF.UC4.Host, written once and linked from every operation page.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-22
---

# Faults and error pipeline

This host installs a service behavior for observability but constructs no typed fault anywhere in its own source. Every failure that is not intercepted by that behavior reaches the caller as WCF's default fault for the thrown exception, carrying full exception detail.

## Error handler

| Aspect | Finding |
| --- | --- |
| `IErrorHandler` installed | Not readable from this host's source.** The in-repository sibling implementation, `ErrorLogErrorHandler : IErrorHandler` (`src/WCF/SAIF.Services.WCF.Host/Extensions/ErrorLogErrorHandler.cs:11`), logs the exception and does not shape the fault. The packaged `SAIF.Services.WCF.Common.Extensions` behavior applied here is expected to follow the same shape,* but this could not be verified from this repository. |
| `ProvideFault` behavior | Unknown — the type is external and its implementation is not in this repository** |

## Service behaviors

| Aspect | Finding |
| --- | --- |
| `IServiceBehavior` applied | `[LogErrorBehavior]` on `UC4Service` (`src/WCF/SAIF.Services.WCF.UC4.Host/UC4Service.cs:20`) |
| Where the attribute type lives | Namespace `SAIF.Services.WCF.Common.Extensions`, **not in this repository** — it arrives from a referenced `SAIF.*` package whose identity could not be resolved from `packages.config`** |
| The in-repository look-alike | `src/WCF/SAIF.Services.WCF.Host/Extensions/LogErrorBehaviorAttribute.cs` declares `LogErrorBehaviorAttribute : Attribute, IServiceBehavior` in namespace `SAIF.Services.WCF.Extensions` — a **different** namespace — and this host has no project reference to it, so it is *not* the type applied here |
| Behavior configuration scope | The `<serviceBehaviors><behavior>` element in `Web.config` is unnamed, so it applies to every service in the host by default |
| Services decorated | `UC4Service` — the only service class this host registers |

**Caller-visible consequence:** reading the `[LogErrorBehavior]` registration as a custom fault envelope would be a defect. By the shape of its in-repository sibling, the applied behavior's `ProvideFault` does not set a fault* — its contribution is observability, not the fault contract.

## Include exception detail in faults

| Setting | Value | Source |
| --- | --- | --- |
| `serviceDebug includeExceptionDetailInFaults` | `true` | `src/WCF/SAIF.Services.WCF.UC4.Host/Web.config` |
| `system.web/customErrors mode` | `Off` | `Web.config` |
| `system.webServer/httpErrors errorMode` | `Detailed` | `Web.config` |

Server exception detail, including stack traces, is returned to every caller of every operation. This host ships no `Web.Release.config` / `Web.Debug.config` transform, so the deployed configuration is the checked-in one unless a release-time transform outside this repository intervenes.**

## Declared fault contracts

| Element | Finding |
| --- | --- |
| `[FaultContract]` declarations | Unknown** — declared, if at all, on the external `IUC4Service` interface, which is not in scope |
| `throw new FaultException` / `FaultException<T>` in host code | None. A search of `src/WCF/SAIF.Services.WCF.UC4.Host/*.cs` for `FaultException` returns no match. No operation constructs a typed or untyped fault. |

## Failure modes by operation

| Operation | What the caller receives on failure |
| --- | --- |
| [`ExecuteJob`](operations/execute-job.md), [`ExecuteJobWithValues`](operations/execute-job-with-values.md), [`ExecuteJobWithParameters`](operations/execute-job-with-parameters.md), [`ExecuteJobWithJson`](operations/execute-job-with-json.md) (enum forms) | Whatever `UC4EnvironmentFactory.GetUC4ClientId(environment)` throws for an unmapped enum value**, then the failure modes of the corresponding `AndClientId` form; all surfaced as WCF default faults with exception detail |
| [`ExecuteJobWithClientId`](operations/execute-job-with-client-id.md) | Failure modes of `ExecuteJobWithValuesAndClientId` (it delegates with an empty value array) |
| [`ExecuteJobWithValuesAndClientId`](operations/execute-job-with-values-and-client-id.md), [`ExecuteJobWithParametersAndClientId`](operations/execute-job-with-parameters-and-client-id.md) | `ArgumentNullException`-family exception from `Enforce.ArgumentNotNull(jobName, "jobName")` when `jobName` is null; `NullReferenceException` if the `uc4.rules` document is missing or does not deserialize (`rules.UC4Rules.Environments` is dereferenced unguarded)*; any exception thrown constructing `UC4Client` or calling the downstream service — all as WCF default faults |
| [`ExecuteJobWithJsonAndClientId`](operations/execute-job-with-json-and-client-id.md) | As above, plus `Newtonsoft.Json` deserialization exceptions from `JsonConvert.DeserializeObject(jsonKeyValuePairs)` on malformed caller input |
| All eight | **A blocked job is not a fault.** When `IsJobAllowed` returns `false`, the operation returns a default-constructed `UC4Result` and the explanatory `message` is discarded — see [BR-UC4-005](business-rules.md#br-uc4-005-blocked-job-returns-empty-result-with-no-explanation) |

## Swallowed failures

No catch block in this host discards an exception without surfacing or logging it. A search of `src/WCF/SAIF.Services.WCF.UC4.Host/*.cs` for `catch` returns no matches at all — this host contains no `try`/`catch` block anywhere in its own source; every exception propagates unhandled to the WCF dispatcher.

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Activation and hosting](activation-hosting.md)
- [Operations](operations.md)
- [Authentication and authorization](authentication-authorization.md)
- [Dependencies](dependencies.md)
- [Configuration](configuration.md)
- [Operations and processes](operations-processes.md)
- [Business rules](business-rules.md)
- [Operational runbook](operational-runbook.md)
- [Tech debt](tech-debt.md)

> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- `src/WCF/SAIF.Services.WCF.UC4.Host/UC4Service.cs`
- `src/WCF/SAIF.Services.WCF.UC4.Host/Uc4Client.cs`
- `src/WCF/SAIF.Services.WCF.UC4.Host/Web.config`
- `src/WCF/SAIF.Services.WCF.Host/Extensions/LogErrorBehaviorAttribute.cs` (comparison only — different namespace, not referenced by this host)
- `src/WCF/SAIF.Services.WCF.Host/Extensions/ErrorLogErrorHandler.cs` (comparison only)
